package com.sddf.system.controller;

import com.sddf.common.result.Result;
import com.sddf.system.mode.dto.UserRegisterDto;
import com.sddf.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 用户模块
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 用户注册
     */
    @PostMapping("/register")
    public Result register(@RequestBody @Valid UserRegisterDto userRegisterDto){
        userService.register(userRegisterDto);
        return Result.ok();
    }
}